modified: openstmerge.py
[GalaxyCodeBases.git] / etc / whichpm / test / Finds core modules
blob27d3018d6eb9219856ce8026d0900d9fe230ce53
1 #!/usr/bin/env bash
3 # ---
4 # IMPORTANT: Use the following statement at the TOP OF EVERY TEST SCRIPT
5 # to ensure that this package's 'bin/' subfolder is added to the path so that
6 # this package's CLIs can be invoked by their mere filename in the rest
7 # of the script.
8 # ---
9 PATH=${PWD%%/test*}/bin:$PATH
11 # Helper function for error reporting.
12 die() { (( $# > 0 )) && echo "ERROR: $*" >&2; exit 1; }
14 out=$(whichpm File::Spec) || die # should succeed
16 pathFragment='/File/Spec.pm'
17 [[ $out =~ "$pathFragment"$ ]] || die "Expected '$pathFragment' in output."
19 # -- With -v, look for core-status indicator
21 coreStatusIndicator='core>='
22 whichpm -v File::Spec | grep -Fq $'\t'"$coreStatusIndicator" || die "Expected core-status indicator '$coreStatusIndicator' in output."
24 exit 0